<%@ page session="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad/html" prefix="trh"%>

<h:panelGroup>
	<fieldset><legend><h:outputText value="Dane wkładki" /></legend>
	<table width="100%" border="0">
		<tr>
			<td align="right"><h:outputText value="Kod:" /></td>
			<td width="30%"><h:inputText styleClass="input_text"
				id="insertionCode" value="#{insertionBean.code}"
				title="Kod winietki" required="false" maxlength="30"
				requiredMessage="Kod jest wymagany"
				style="width:100%;display:block;" /> <h:message for="insertionCode"
				styleClass="validation_info" /></td>

			<td align="right"><h:outputText value="Cena jednostkowa:" /></td>
			<td width="25%"><h:selectOneListbox id="insertionunitpriceList"
				styleClass="input_text" value="#{insertionBean.unitprice}" size="1"
				required="true"
				requiredMessage="Cena jednostkowa za zaproszenie jest wymagana"
				style="width:100%;">
				<f:selectItem itemLabel="brak" />
				<f:selectItems value="#{ConstantDictionaries.priceTypes}" />
			</h:selectOneListbox> <h:message for="insertionunitpriceList" styleClass="validation_info" />
			</td>
		</tr>
		<tr>
			<td align="right"><h:outputText value="Całkowita ilość:" /></td>
			<td width="30%"><h:inputText styleClass="input_text"
				id="insertiontotalCount" value="#{insertionBean.totalcount}"
				title="Kod winietki" required="false"
				requiredMessage="Ilość musi być większa od 0"
				style="width:100%;display:block;">
				<f:convertNumber integerOnly="true" />
			</h:inputText> <h:message for="insertiontotalCount" styleClass="validation_info" />
			</td>
			<td align="right"><h:outputText value="Ilość z nadrukiem:" /></td>
			<td><h:inputText styleClass="input_text" id="overprintCount"
				value="#{insertionBean.overPrintCount}" title="Ilość z nadrukiem"
				required="false" requiredMessage="Ilość musi byś większa od 0"
				style="width:100%;display:block;">
				<f:convertNumber integerOnly="true" />
			</h:inputText> <h:message for="overprintCount" styleClass="validation_info" /></td>
		</tr>
		<tr>
			<td align="right"><h:outputText value="Uwagi:" /></td>
			<td colspan="3"><h:inputTextarea styleClass="input_text"
				cols="40" rows="4" value="#{insertionBean.note}" title="Uwagi"
				style="width:100%;" /></td>
		</tr>
		<tr>
			<td colspan="2" align="left">
			</td>
			<td colspan="2" align="right"><tr:commandButton
				action="#{orderController.saveInsertionItem}"
				rendered="#{not empty insertionBean.order}" text="Zapisz zmiany" />
			<tr:commandButton
				action="#{orderController.addInsertionToOrder}"
				rendered="#{empty insertionBean.order}" text="Dołącz do zamówienia" />
			</td>
		</tr>
	</table>

	</fieldset>
</h:panelGroup>